package com.mali.api.client;

import com.mali.api.config.SeataFeignConfiguration;
import com.mali.common.dto.Result;
import com.mali.common.web.domain.dto.PageRequestDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;

@FeignClient(name = "permission-service", configuration = SeataFeignConfiguration.class)
public interface PermissionClient {
    @GetMapping("/permission/defaultRole")
    Result<String> defaultRole(@RequestParam("userId") Long userId);

    @GetMapping("/permission/getCode")
    Result<Integer> getCode(@RequestParam("userId") Long userId);

    @PutMapping("/permission/update/admin")
    Result<Boolean> updateToAdmin(@RequestParam("userId") Long userId);

    @PutMapping("/permission/update/user")
    Result<Boolean> updateToUser(@RequestParam("userId") Long userId);

    @PostMapping("permission/commonUserList")
    Result<Collection<Long>> getCommonUserList(@RequestBody PageRequestDTO pageRequestDTO);

    @PostMapping("permission/adminUserList")
    Result<Collection<Long>> getAdminUserList(@RequestBody PageRequestDTO pageRequestDTO);
}
